package gameobjects
{
	import assets.Globals;
	import assets.Images;
	
	import com.greensock.TweenMax;
	import com.greensock.easing.Linear;
	
	import flash.events.Event;

	public class Projectile extends GameObject
	{
		protected var dmgHP:Number;
		protected var dmgSlow:Number;
		protected var dmgShield:Number;
		protected var passThrough:Boolean;
		protected var passHops:int;
		protected var myTween:TweenMax = null;
		
		public function Projectile(dmgHP:Number = 22,
								   dmgSlow:Number = 0,
								   dmgShield:Number = 0,
								   passThrough:Boolean = false,
								   passHops:int = 2)
		{
			super(1);
			this.dmgHP = dmgHP;
			this.dmgSlow = dmgSlow;
			this.dmgShield = dmgShield;
			this.passThrough = passThrough;
			this.passHops = passHops;
		}
		
		public function hit(object:GameObject):void
		{
			object.decreaseHealth(dmgHP);
			if (passThrough) {
				passHops--;
				if (passHops == 0)
					destroy();
			} else
				destroy();
		}
		
		public function stop():void 
		{
			myTween.pause();
		}
		
		public function move():void {
			myTween.resume();
		}
	}
}